package com.thinkcms.seo.seo.core;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;

public class HttpHeaderInterceptor implements Interceptor {
    @NotNull
    @Override
    public Response intercept(@NotNull Chain chain) throws IOException {
        Request originRequest = chain.request();
        originRequest= originRequest.newBuilder().addHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36")
        .addHeader("Sec-Fetch-Site"," same-origin").addHeader("Accept-Language"," zh-CN,zh;q=0.9").
        addHeader("is_xhr","1").addHeader("Cookie","__cfduid=d41143d2536a519d4ba8ae9dbae8162121564500497; PSTM=1578829805; BAIDUID=65E5001168BA49A652AE3E850D3AC8DF:FG=1; BIDUPSID=B30D664B6FE79BE2B254746B079B4EB7; BD_UPN=12314753; H_WISE_SIDS=138595_136381_114552_139405_114744_135847_141003_138946_120199_138656_140832_140141_133995_138878_137985_140173_131246_132551_141261_118891_118876_118840_118832_118791_138165_107312_138883_140260_140631_136862_138585_139177_139625_140114_136196_140590_139431_139693_133847_140792_140065_134046_131423_140383_140838_136413_141103_110085_140986_140253_127969_140954_140593_140864_139884_139409_128200_138312_138426_141194_138942_140682_141191_140597_140962; BDUSS=9oTlE4Vn44T055OE9GaXBOYndnTGVHWnllc0h0anpha3ZJdFQySzJkdTB0MUJlRVFBQUFBJCQAAAAAAAAAAAEAAAAREk0ocWF6eHN3MDk4YWJjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALQqKV60Kilebm; yjs_js_security_passport=b0167a0ee0c941d0b5b65dcc3c556234b256d567_1580292300_js; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; H_PS_PSSID=1452_21100_26350_30482; H_PS_645EC=c4892kBlrutPWlzguXvPRAazURofGKWl5Yi7oRRa5ERSbARdEHAkSU8iDIryW%2BOngJZb; BDRCVFR[feWj1Vr5u3D]=I67x6TjHwwYf0; delPer=0; BD_CK_SAM=1; PSINO=1; BD_HOME=1; sugstore=0; BDSVRTM=16; WWW_ST=1580368973892").build();
        return chain.proceed(originRequest);
    }
}
